package org.scala.javafx.apps

object TrackedListTest {
  implicit def track[A](list: List[A]) = new Object {
    def track[U](f: TrackedList[A] => U): U = f(TrackedList[A](list))
  }
  
  def main(args: Array[String]): Unit = {
    val trackedList = List(21, 22, 23).track { x =>
      println(18 :: 19 :: 20 :: x)
      val result = (18 :: 19 :: 20 :: x).drop(1).drop(1)
      println(result)
      println(result.untracked)
      for (x <- result) {
        println(x)
      }
    }
  }
}
